babl: in babl_polynomial_approximate_gamma(), verify that x0 >= 0
authorEll <ell_se@yahoo.com>
Sun, 24 Sep 2017 21:46:50 +0000 (17:46 -0400)
committerEll <ell_se@yahoo.com>
Sun, 24 Sep 2017 21:50:18 +0000 (17:50 -0400)
Now that the previous commit (hopefully) makes us iPhone-proof, we
can add an assertion for this condition.  If we want to replace the
assertions with some sort of bailing, we'll need to replace the rest
of them too anyway.

babl/babl-polynomial.c

index c9f195b73bf9b2748cd6e18fd3dfac604804e6be..82f9ce4d3e4d95bd6d04f90311e6827975961936 100644 (file)
@@ -516,6 +516,7 @@ babl_polynomial_approximate_gamma (BablPolynomial *poly,
 
   babl_assert (poly != NULL);
   babl_assert (gamma >= 0.0);
+  babl_assert (x0 >= 0.0);
   babl_assert (x0 < x1);
   babl_assert (degree >= BABL_POLYNOMIAL_MIN_DEGREE &&
                degree <= BABL_POLYNOMIAL_MAX_DEGREE);